home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wics.zip / NUMEDIT.H < prev    next >
C/C++ Source or Header  |  1993-01-29  |  2KB  |  69 lines

  1. #ifndef _NUMEDIT_H
  2. #define _NUMEDIT_H
  3.  
  4. #include <wics.h>
  5. #include <edit.h>
  6.  
  7. #pragma option -Vo-
  8. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  9. #pragma option -po-
  10. #endif
  11.  
  12. _CLASSDEF (TNumericEdit)
  13.  
  14. class TNumericEdit : public TEdit
  15. {
  16. private:
  17.     virtual const Pchar streamableName() const { return "TNumericEdit"; }
  18.  
  19. protected:
  20.     virtual LPSTR GetClassName() { return "WICSDateEdit"; }
  21.     virtual void SetupWindow();
  22.  
  23.     virtual void WMCommand(RTMessage) = [WM_FIRST + WM_COMMAND];
  24.  
  25.     TNumericEdit(StreamableInit) : TEdit(streamableInit) {};
  26.  
  27. public:
  28.     TNumericEdit (PTWindowsObject AParent, int ResourceId, PTModule AModule = NULL);
  29.     ~TNumericEdit ();
  30.  
  31.     int  GetLineLength();
  32.     BOOL GetLine(LPSTR ATextString, int StrSize);
  33.     BOOL DeleteLine(int) { return !(BOOL) SendMessage(HWindow, WM_CLEAR, 0, 0); }
  34.  
  35.     //    Redefine the following functions to do nothing. They serve no purpose in the 
  36.     //    Numeric Edit control.
  37.         
  38.     BOOL CanUndo() { return FALSE; }
  39.     int  GetLineFromPos(int) { return 0; }
  40.     int  GetLineIndex(int) { return 0; }
  41.     void Scroll(int, int) { return; }
  42.     int  Search(int, LPSTR, BOOL) { return -1; }
  43.     void GetSubText(LPSTR, int, int) { return; }
  44.  
  45.     int  GetInt ();
  46.     long GetLong ();
  47.     void SetInt (int i);
  48.     void SetLong (long l);
  49.  
  50.     static PTStreamable build();
  51.  
  52. };
  53.  
  54. inline Ripstream operator >> ( Ripstream is, RTNumericEdit cl )
  55.     { return is >> (RTStreamable )cl; }
  56. inline Ripstream operator >> ( Ripstream is, RPTNumericEdit cl )
  57.     { return is >> (RPvoid)cl; }
  58.  
  59. inline Ropstream operator << ( Ropstream os, RTNumericEdit cl )
  60.     { return os << (RTStreamable )cl; }
  61. inline Ropstream operator << ( Ropstream os, PTNumericEdit cl )
  62.     { return os << (PTStreamable )cl; }
  63.  
  64. #pragma option -Vo.
  65. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  66. #pragma option -po.
  67. #endif
  68.  
  69. #endif